<div class="row">
    <div class="col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4">
        <span class="text-center">
            <?php echo $this->flashMessenger()->render('error', array('alert', 'alert-danger')); ?>
        </span>
        <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Register</h3>
            </div>
            <div class="panel-body">
                <?php
                    $form = $this->form;
                    $form->setAttribute('action',$this->url('user-auth/default',array('action'=>'register')));
                    $form->prepare();
                ?>
                <?php echo $this->form()->openTag($form); ?>

                <div class="form-group col-xs-12 <?php echo ($this->formElementErrors($form->get('username'))) ? 'has-error' : '' ; ?>">
                    <?php echo $this->translate($this->formLabel($form->get('username'))); ?>
                    <?php echo $this->formInput($form->get('username')); ?>
                    <div class="col-sm-12">
                        <div class="help-block"><?php echo $this->translate($this->formElementErrors($form->get('username'))); ?></div>
                    </div>
                </div>
                <div class="form-group col-xs-12 <?php echo ($this->formElementErrors($form->get('email'))) ? 'has-error' : '' ; ?>">
                    <?php echo $this->translate($this->formLabel($form->get('email'))); ?>
                    <?php echo $this->formInput($form->get('email')); ?>
                    <div class="col-sm-12">
                        <div class="help-block"><?php echo $this->translate($this->formElementErrors($form->get('email'))); ?></div>
                    </div>
                </div>
                <div class="form-group col-xs-12 <?php echo ($this->formElementErrors($form->get('password'))) ? 'has-error' : '' ; ?>">
                    <?php echo $this->translate($this->formLabel($form->get('password'))); ?>
                    <?php echo $this->formInput($form->get('password')); ?>
                    <div class="col-sm-12">
                        <div class="help-block"><?php echo $this->translate($this->formElementErrors($form->get('password'))); ?></div>
                    </div>
                </div>
                <div class="form-group col-xs-12 <?php echo ($this->formElementErrors($form->get('confirmation'))) ? 'has-error' : '' ; ?>">
                    <?php echo $this->translate($this->formLabel($form->get('confirmation'))); ?>
                    <?php echo $this->formInput($form->get('confirmation')); ?>
                    <div class="col-sm-12">
                        <div class="help-block"><?php echo $this->translate($this->formElementErrors($form->get('confirmation'))); ?></div>
                    </div>
                </div>
                <div class="form-group col-xs-12 <?php echo ($this->formElementErrors($form->get('terms'))) ? 'has-error' : '' ; ?>">
                    <div class="col-xs-12">
                        <?php echo $this->formCheckbox($form->get('terms')); ?>
                        <?php echo $this->translate($this->formLabel($form->get('terms'))); ?>
                    </div>
                    <div class="col-sm-12">
                        <div class="help-block"><?php echo $this->translate($this->formElementErrors($form->get('terms'))); ?></div>
                    </div>
                </div>
                <div class="col-xs-12">
                    <?php echo $this->formButton()->openTag($form->get('submit')); ?>
                        <i class="fa fa-check"></i> <?php echo $this->translate($form->get('submit')->getValue()); ?>
                    <?php echo $this->formButton()->closeTag(); ?>
                </div>

                <?php echo $this->form()->closeTag(); ?>
            </div>
        </div>
    </div>
</div>
